package com.ucex.common.rocketmq.domain;

import java.io.Serializable;

import lombok.Data;

/**
 * 发送消息基类
 */
@Data
public class MessageEntity<T> implements Serializable{

    /**
     *
     */
    private static final long serialVersionUID = 6908062628916460490L;
    
    
    //消息对应的Topic
    private String topic;
    //消息对应的Tag
    private String tag;
    //该字段是阿里云建议做幂等处理的字段
    private String key;
    //分组
    private String groupId;

    //设置消息的定时投递时间（绝对时间),最大延迟时间为7天,延迟投递: 延迟3s投递, 设置为: System.currentTimeMillis() + 3000
    private Long startDeliverTime;

    private T data;

    public MessageEntity() {}
    public MessageEntity(String topic, String tag) {
        this.topic = topic;
        this.tag = tag;
    }

    public MessageEntity(String topic, String tag, String key) {
        this.topic = topic;
        this.tag = tag;
        this.key = key;
    }
 
}
